package com.cskaoyan.model;

import java.util.Date;

/**
 * @description：TODO
 * @author     ：huzhouming
 * @date       ：2022/5/9 20:35
 */
public class OrderInfo {

    /**
     * consignee : 啥
     * address : 天津市市辖区和平区 萨达
     * addTime : 2022-05-09 19:13:36
     * orderSn : 20220509327410
     * actualPrice : 467.01
     * mobile : 12345678910
     * message :
     * orderStatusText : 已取消(系统)
     * aftersaleStatus : 0
     * goodsPrice : 567.01
     * couponPrice : 100.0
     * id : 160
     * freightPrice : 0.0
     * handleOption : {"cancel":false,"confirm":false,"rebuy":false,"pay":false,"comment":false,"delete":true,"aftersale":false,"refund":false}
     */
    private String consignee;
    private String address;
    private Date addTime;
    private String orderSn;
    private double actualPrice;
    private String mobile;
    private String message;
    private String orderStatusText;
    private Short aftersaleStatus;
    private double goodsPrice;
    private double couponPrice;
    private int id;
    private double freightPrice;
    private short orderStatus;
    private HandleOption handleOption = new HandleOption();

    public void setConsignee(String consignee) {
        this.consignee = consignee;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    public void setActualPrice(double actualPrice) {
        this.actualPrice = actualPrice;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void setOrderStatusText(String orderStatusText) {
        this.orderStatusText = orderStatusText;
    }

    public void setAftersaleStatus(Short aftersaleStatus) {
        this.aftersaleStatus = aftersaleStatus;
    }

    public void setGoodsPrice(double goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    public void setCouponPrice(double couponPrice) {
        this.couponPrice = couponPrice;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setFreightPrice(double freightPrice) {
        this.freightPrice = freightPrice;
    }

    public void setOrderStatus(Short orderStatus) {
        switch (orderStatus){
            case 101:
                this.orderStatusText = "未付款";
                this.handleOption.setCancel(true);
                this.handleOption.setPay(true);
                break;
            case 102:
                this.orderStatusText = "用户取消";
                this.handleOption.setDelete(true);
                break;
            case 103:
                this.orderStatusText = "系统取消";
                this.handleOption.setDelete(true);
                break;
            case 201:
                this.orderStatusText = "已付款";
                this.handleOption.setRefund(true);
                break;
            case 202:
                this.orderStatusText = "申请退款";
                break;
            case 203:
                this.orderStatusText = "已退款";
                this.handleOption.setDelete(true);
                break;
            case 301:
                this.orderStatusText = "已发货";
                this.handleOption.setConfirm(true);
                break;
            case 401:
                this.orderStatusText = "用户收货";
                this.handleOption.setDelete(true);
                this.handleOption.setAftersale(true);
                this.handleOption.setRebuy(true);
                this.handleOption.setComment(true);
                break;
            case 402:
                this.orderStatusText = "系统收获";
                this.handleOption.setDelete(true);
                this.handleOption.setAftersale(true);
                this.handleOption.setRebuy(true);
                this.handleOption.setComment(true);
                break;
        }
    }

    public String getConsignee() {
        return consignee;
    }

    public String getAddress() {
        return address;
    }

    public Date getAddTime() {
        return addTime;
    }

    public String getOrderSn() {
        return orderSn;
    }

    public double getActualPrice() {
        return actualPrice;
    }

    public String getMobile() {
        return mobile;
    }

    public String getMessage() {
        return message;
    }

    public String getOrderStatusText() {
        return orderStatusText;
    }

    public Short getAftersaleStatus() {
        return aftersaleStatus;
    }

    public double getGoodsPrice() {
        return goodsPrice;
    }

    public double getCouponPrice() {
        return couponPrice;
    }

    public int getId() {
        return id;
    }

    public double getFreightPrice() {
        return freightPrice;
    }

    public HandleOption getHandleOption() {
        return handleOption;
    }
}
